Skip to content

feat(installer): prepare HA plugin one-click release - #3

Open
zjhong wants to merge 73 commits into
mainfrom
wp/t6-ha-public-release
Open

zjhong wants to merge 73 commits into
mainfrom
wp/t6-ha-public-release

Conversation

@zjhong

@zjhong zjhong commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add the reviewed P-256 trust root and signed, architecture-specific Home Assistant bundle delivery to the installer activation path.
  • Keep plugin bundle failures from preventing the ThingsPanel core from recovering, while returning an explicit non-success status when the HA Agent is unavailable.
  • Persist pending activation before Agent side effects, resume it after an interrupted install, and retry from a fresh signed catalog rather than reviving an expired pending catalog.
  • Preserve the legacy installer artifacts and unrelated plugin secret-field support.

Validation

  • python3 -m unittest tests.test_update_transaction tests.test_reconcile_activation tests.test_agent_host tools.test_plugin_bundle tests.test_plugin_bundle_activation tools.test_plugin_install -v — 106 passed.
  • Python compilation, Bash syntax, installer/updater SHA pins, helper SHA pin, and git diff --check passed.

Release boundary

This PR prepares the installer and candidate build workflow. It does not itself publish a permanent HA Release asset or Pages catalog, and it does not claim clean-host installation acceptance. The candidate build workflow is not yet available on the default branch until this PR is accepted.

zjhong and others added 30 commits November 2, 2026 00:59
Source worktree: /Volumes/500G/code/team-b-installer-20261102
Source HEAD: 282eb7c
Source patch SHA256: 1d80bcbffbb99171dbbbd6df452e619035c10691679e7e39f4f0cc5f50cf83fc
Preserves existing team changes; verification remains scoped to the recorded handoff.
Adds config/native/release_manifest.py: verifies a manifest signature against a
caller-pinned ECDSA P-256 root, then checks publisher, version, validity window,
revocation and the exact payload contents (path, size, SHA-256; no missing,
extra or symlinked files; clean relative paths only).

No trust root ships with the repository, so verification fails closed until the
release owner supplies one. The mechanism is not yet wired into the install and
upgrade entry points, and there is no PowerShell implementation. See
docs/release-manifest.md.

Verified: tests.test_release_manifest 16/16; full tests/ discovery 67/67.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
update.py checks every staged file against a signed manifest before any
installed file changes when a trust root is configured, and fails closed
when a signature is required but no root is available. The verifier is
pinned by digest inside update.py; entry points repin update.py and pass
TP_RELEASE_TRUST_ROOT / TP_REQUIRE_SIGNED_RELEASE / TP_REVOKED_VERSIONS.
Default behaviour without a trust root is unchanged.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ed defaults

Allows several stacks (and test installs) on one host without editing the
managed compose file. Defaults are identical to the previous fixed ports.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ults unchanged)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
COMPOSE_PROFILES=tdengine adds a TDengine service; TP_HISTORY_BACKEND=tdengine
and TP_TDENGINE_EXPERIMENTAL=true select it in the backend. TP_BACKEND_IMAGE
allows a backend image that contains the TDengine history backend. Defaults
are unchanged (postgres history, v1.3.0 image).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
After an upgrade that recreated backend, notification-core kept serving 503
(Service Unavailable) until restarted manually, so installation verification
failed. Observed on a real upgrade of a fresh PG+Timescale install.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…only after compose up and verification pass

A failed native verification (for example a transient 503) left the journal in
activation_started with no supported way forward. The new command re-runs only
the idempotent tail and never rolls back or re-applies configuration.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…erification

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ated"

The change did not remove the notification-core 503 observed after installer
activation runs (it recurs after a SIGKILL-interrupted run and is only cleared
by restarting notification-core); root cause is still open.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… instead of pulling

Mirrors the existing ThingsVis local-image rule: an ID mismatch fails and never
falls back to a registry. Needed to install and upgrade with a locally built
backend image.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…aced after they started

Atomic replacement of managed files leaves running containers on the old
inode; notification-core then answered 503 to every request until restarted
(reproduced on OrbStack by replacing runtime.notification.json). The activation
and reconcile paths now restart exactly those services before verification.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
broker-owner must be restarted before mosquitto (shared network namespace) and
frontend must follow a backend restart (nginx keeps the old upstream address).
Verified on a real PG+Timescale stack.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ectory

The journal pinned the absolute install path, so after moving a finished
installation the installer refused to run (journal invalid). Only complete or
recovered journals are re-rooted; unresolved ones stay bound to their path.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ifest for a frozen payload

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…ble backend image

With TP_BACKEND_IMAGE overridable, the uninterpolated Compose image ended in
'v1.3.0}', so --expected-version always failed. Found by the signed install.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…nfigured

Produces release-manifest.json and .sig with tools/sign_release.py and attaches
them to the release. Skipped with a warning when the secret is absent. Not yet
exercised in GitHub Actions; the public trust root must be distributed out of band.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… retire on the create-only adapter

A prepared container still never starts without an explicit, time-limited grant for the
accepted generation. Revocation is durable and permanent for a generation; lease expiry
and a newer accepted generation both stop the container; Retire removes a superseded,
stopped container so the newer generation can prepare. Seven real-Docker tests (opt-in)
cover ungranted, granted, revoked, old generation, superseded, lost control plane and restart.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…th real-Docker end-to-end test

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…p-agentctl

Lets a reviewed profile run a real platform plugin (user-defined network, fixed environment,
pinned image's own declarations) while everything else stays fenced; defaults keep the original
create-only policy. The full real-Docker suite (41) and the service end-to-end test still pass.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… (catalog verify, platform binding, Agent install)

plugin_catalog.py publishes and verifies an ECDSA-signed plugin catalog; plugin_install.py verifies it,
creates the platform-side device template, installs the plugin through the host Agent and registers a
first device. Verified up to the plugin uplink: the develop backend deliberately rejects the legacy
anonymous plugin runtime endpoints (PLUGIN_RUNTIME_IDENTITY_REQUIRED), so the last step is blocked until
managed plugin runtime identities exist.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…er generation

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… via Agent env, binding none, env_user prompts, uninstall (T5)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
zjhong and others added 24 commits November 5, 2026 21:01
…log for old images

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The Agent verifies the signed plugin catalog itself, builds the container profile from the
verified entry, keeps site secrets/identity tokens/stack credentials in its own 0600 store
(profiles and the state journal hold only @secret: placeholders), and exposes
catalog/config-put/config-keys/config-clear. No free profile, image, command or mount.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…trap

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…install API

Install/uninstall of binding:none plugins call POST/DELETE /api/v1/plugin/installs (the same
engine the UI uses); renew is automatic for platform-managed plugins. The CLI's own
service_plugins registration code and its tests are removed (single implementation).
binding:template plugins (http-adapter) keep the old path until the engine supports them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…lugininstall); merge wp/pui-agent

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…r side (pui-agent)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
❌ Deployment failed
View logs
thingspanel-installer 1f2f5a9 Nov 08 2026, 01:53 AM

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant